-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Revcontent Adapter #4654
Add Revcontent Adapter #4654
Conversation
@AzizSaleh Now we're talkin! Thanks, I will review and make some official comments sometime today / tomorrow. We will be able to get this into the next prebid release! |
Thanks man! Much appreciated. |
code: BIDDER_CODE, | ||
supportedMediaTypes: ['banner', 'native', 'video'], | ||
isBidRequestValid: function (bid) { | ||
return (typeof bid.params.apiKey !== 'undefined' && typeof bid.params.userId !== 'undefined' && bid.hasOwnProperty('nativeParams')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so no matter what each bid needs nativeParams
?
Is revcontent only doing native ads?
Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep only native at this time. I am going to update supportedMediaTypes
to reflect.
} | ||
|
||
if (typeof domain === 'undefined') { | ||
domain = extractHostname(refererInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it may
be possible that refererInfo
is undefined
at this point.
Which I believe could throw Cannot read property 'indexOf' of undefined
inside the function extractHostname
May be a good idea to default this or skip this if refererInfo
is not defined here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to update the actual function to return an empty string in such event.
modules/revcontentBidAdapter.js
Outdated
domain = extractHostname(refererInfo); | ||
} | ||
|
||
var endpoint = '//' + host + '/rtb?apiKey=' + apiKey + '&userId=' + userId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Prebid 3.0 we now require only HTTPS connections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to update it so that it is secure all the time.
modules/revcontentBidAdapter.js
Outdated
endpoint = endpoint + '&widgetId=' + widgetId; | ||
} | ||
|
||
let secure = location.protocol === 'https:'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks to be a param passed to your ad exchange.
As noted above, we are requiring that all connections to be HTTPS now.
So not sure if you want to update this to always be true
let secure = location.protocol === 'https:'; | ||
|
||
const imp = validBidRequests.map((bid, id) => { | ||
if (bid.hasOwnProperty('nativeParams')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like (as mentioned above) nativeParams
will always be on your bids since you are requiring it in validateBidRequests
|
||
return asset; | ||
} | ||
}).filter(Boolean); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice usage of filter(Boolean)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fair, I copied that from the openRtb adapter implementation (since we are also using open rtb on the backend as well).
modules/revcontentBidAdapter.js
Outdated
|
||
export const spec = { | ||
code: BIDDER_CODE, | ||
supportedMediaTypes: ['banner', 'native', 'video'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we are only supporting native
as of now since nativeParams
is required on every bid?
@AzizSaleh Couple of questions. |
When testing the adapter I noticed the Which then throws a:
Probably works fine for normal hostnames but wanted you to be aware. |
var host = extractHostname(winUrl); | ||
|
||
ajax(winUrl + '&viewed=1', null, {withCredentials: true}); | ||
ajax('https://' + host + '/imp.php', null, 'v=' + encodeURIComponent(encodeURIComponent(getQueryVariable('d', winUrl))) + '&i=' + encodeURIComponent(window.location.href), {method: 'POST', contentType: 'application/x-www-form-urlencoded'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we do allow listening and firing imp trackers, can you explain the necessity to fire TWO imp trackers here?
We have allowed adapters to fire one in previous PR's, but wanted to know this use case and see if it can be updated to fire a single ajax call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are for different uses at the moment, we are working on reducing them into 1 call but to have accurate reporting we will need them both atm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AzizSaleh Ok, so I spoke with the Prebid Org team and while we are a little hesitant as we want to limit things like this, we will allow it.
So whenever your team gets around to reducing it to 1 please make the corresponding change here!
It may become a restricted thing in a future version of Prebid (Only allowing one track to fire per bidWon) but I will let you know ahead of time.
Yep that also happened to me while testing locally. Had to upload it live to see actual results: |
…tractHostname method
@robertrmartinez I made a few updates, however, when doing a git pull (force of habit before committing) seems like pakage-lock.json. If everything looks fine, I can re-create the branch like I did last time to avoid that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok looks good!
@robertrmartinez Greatly appreciate the +1. Quick question about the process, when should we expect a merge/deploy and what other steps do we need to do (more of timeline process question). |
@AzizSaleh We will be releasing a new Prebid Version later today or tomorrow, so I will be sure to merge this into master before that! So your adapter will officially be in Prebid Versions |
@AzizSaleh Well I am really sorry but I dropped the ball! I just now realized that you do not even have a test file. We require that each adapter has a spec file which institutes 80% test coverage! I went to check the test coverage for your adapter and realized it did not have a file at all! Can you please add a file and get it up to 80%. |
@robertrmartinez Added the test file + removed a missed console.log on actual adapter. |
…idVersion1.2.0 * 'master' of https://github.com/prebid/Prebid.js: (22 commits) fix lint errors in unit test file (prebid#4702) Add Revcontent Adapter (prebid#4654) Changed data structure in Platform One Analytic Adapter (prebid#4647) increment pre version Prebid 3.2.0 Release Add static API option to the consentManagementUsp module. (prebid#4685) replace all xhr stubs with global xhr stub to prevent all requests (prebid#4687) Add CCPA us_privacy support to spotxBidAdapter (prebid#4689) ucfunnel adapter support CCPA and remove utils.js in adapter (prebid#4541) freewheelSSPBidAdapter (prebid#4645) Add CCPA support to Beachfront adapter (prebid#4673) add seedingAlliance Adapter (prebid#4614) Changed analytics data structure in YuktaMedia Analytic Adapter (prebid#4659) Add eplanning adapter for prebid 3.0 compliant and CCPA and GDPR support (prebid#4643) Bidder schain support (prebid#4551) Added CCPA support and GDPR compliance to Cedato adapter (prebid#4683) pass us privacy consent string to request (prebid#4581) Prebid 3 Admixer (prebid#4615) Pass uspConsent in bidRequest (prebid#4675) Advertly: New Bidder Adapter Submission (prebid#4496) ...
* Initial commit * Update * Update js * Update file name * Making it work (at least getting a response) * Update native logic * Updates to bidder * Update prebidder * Remove debugs * Updates * Add new templates * Update templates * Update email address * Resolve conflict * Resolve conflict * Rebase from master * Rebase from master * Add Revcontent Adapter * Force https, update supportedMediaTypes and add default return for extractHostname method * Add test file + remove console.log statement
Type of change
Description of change
Adding RevContent Bidder
Test page: /integrationExamples/gpt/revcontent_example.html
contact email of the adapter’s maintainer: aziz@revcontent.com
[x] official adapter submission
For any changes that affect user-facing APIs or example code documented on http://prebid.org, please provide: